Many virtualized computer systems run device drivers inside a virtual machine (referred to herein as a “driver VM”) rather then inside the hypervisor for reasons of stability and safety. A driver VM utilizes pre-existing device drivers developed for the guest operating system of the driver VM thereby eliminating the necessity of writing device drivers specifically for the hypervisor. As such, hypervisor design is simplified, thereby potentially making the virtualized environment more stable. Furthermore, from a safety perspective, potential bugs in the device drivers will not compromise the hypervisor or other virtual machines (VMs) because the effect of the bugs will be contained within the driver VM. However, the use of driver VMs does result in performance loss. Specifically, to handle device I/O events for any particular VM (referred to herein as a “user VM”), the hypervisor must invoke the driver VM to handle the device I/O event and the driver VM, in turn, must ultimately notify the requesting user VM upon completion of the device I/O event (e.g., by trapping to the hypervisor to request an inter-VM notification to the user VM). Extra context switching overhead is incurred in invoking the driver VM and handling interrupts and inter-VM notifications to inform the user VM.
Running a driver VM based virtualized environment in a computer system with a multi-core processor has the potential to reduce performance losses caused by the driver VM. Multi-core processors provide multiple central processing units (CPUs) or cores on a single silicon chip. These CPUs operate concurrently and can read and write to any portion of a computer system's memory. Multi-core processors provide significant increases in performance when a computer system's workload is highly parallelized such that each core runs portions of the computer system's workload simultaneously. As such, running multiple virtual machines (VMs) on a multi-core processor architecture results in increased performance because each virtual machine can run simultaneously on separate processing cores.
In a computer system having a multi-core processor, a driver VM can run in parallel with another user VM for which it is currently handling device I/O if each of the VMs runs on a different core. However, due to time sharing and multitasking of processes (e.g., different VMs) on each CPU core, it is difficult to ensure that a particular user VM has timely possession of a CPU core to process I/O data that has been made available to it by a driver VM running on a different CPU core. This problem is further compounded by the amount of computing resources needed to transmit an inter-VM notification from a driver VM to a user VM through the hypervisor to notify the user VM that I/O data is available.